package yt.demo.appcoresystem.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import yt.demo.appcommondb.base.BaseEntity;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(name = "SystemRole", description = "系统菜单")
public class SystemRole  extends BaseEntity<SystemRole> {

    @TableId
    @Schema(name = "id", description = "主键ID")
    @NotNull(groups = UpdateGroup.class,message = "id不能为空") // 更新时确保此字段不能为空
    private Long id;

    @NotNull(groups = {CreateGroup.class, UpdateGroup.class},message = "角色名称不能为空")
    @Schema(name = "name", description = "角色名称")
    private String name;

    @Schema(name = "code", description = "角色代码")
    private String code;

    @Schema(name = "status", description = "状态 (1正常 2停用)")
    private Integer status;

    @Schema(name = "dataScope", description = "数据范围（1：全部数据权限 2：自定义数据权限 3：本部门数据权限 4：本部门及以下数据权限 5：本人数据权限）")
    private Integer dataScope;

    @Schema(name = "sort", description = "排序")
    private Integer sort;

    @Schema(name = "remark", description = "备注")
    private String remark;



}
